package com.design.pattern.simple.factory;

/**
 * @Description 加减乘除简单工厂测试类，后面策略模式用策略模式会更好
 * @author ll
 * @createTime 2021/5/31  16:41 
 */
public class Main {

	public static void main(String[] args) {

//		Operator operator = SimpleFaction.getOperator("+");
//		operator.setA(3);
//		operator.setB(4);
//		System.out.println(operator.function());

//		Operator operator = SimpleFaction.getOperator("-");
//		operator.setA(3);
//		operator.setB(4);
//		System.out.println(operator.function());

//		Operator operator = SimpleFaction.getOperator("*");
//		operator.setA(3);
//		operator.setB(4);
//		System.out.println(operator.function());

		Operator operator = SimpleFaction.getOperator("/");
		operator.setA(3);
		operator.setB(4);
		System.out.println(operator.function());
	}

}
